<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<header th:replace="header::header_index(title)(${title})"></header>
<header th:replace="avatar::header"></header>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow: hidden">
	<div id="wrapper">
		<nav class="navbar-default navbar-static-side" role="navigation" th:fragment="menu">
			<div class="sidebar-collapse">
				<ul class="nav" id="side-menu">
					<li class="nav-header">
						<div class="profile-element">
							<a href="#" data-target="#avatar" data-toggle="modal"><img alt="image" class="img-circle" id="user-avatar" name="user-avatar"
								th:src="${#httpServletRequest.getContextPath()}+${user.picId}" /></a>
						</div>
						<div class="logo-element">YiMo</div>
					</li>
					<li th:each="menu : ${menus}"><a href="#"> <i class="fa fa fa-bar-chart-o" th:class="${menu.attributes.icon}"></i> <span class="nav-label" th:text="${menu.text}"></span>
							<span class="fa arrow"></span>
					</a>
						<ul class="nav nav-second-level">
							<li th:each="cmenu : ${menu.children}"><a class="J_menuItem" href="#" th:href="${cmenu.attributes.url}"> <i class="fa fa fa-bar-chart-o"
										th:class="${cmenu.attributes.icon}"></i> <span class="nav-label" th:text="${cmenu.text}"></span></a></li>
						</ul></li>
				</ul>
			</div>
		</nav>
		<div th:replace="rightContent :: 	right-content"></div>
		<!-- 		<div th:replace="rightSidebar :: right-sidebar"></div> -->
		<div th:replace="footer :: footer_index"></div>
	</div>
	
	<script type="text/javascript">
		var stompClient = null;
        $(function() {
	        connect();
        });

        function connect() {
	        var sock = new SockJS(ctx + "websocket");
	        var stomp = Stomp.over(sock);
	        // 		        console.log("进入sock连接");
	        stomp.connect('guest', 'guest', function(frame) {
		        // 				stomp.subscribe("/topic/ReceiveTest", handleNotification);
		        // 				stomp.send("/queue/sendTest",{},'发送消息文本内容');

		        stomp.subscribe("/topic/webSocketMessageJob", handleNotification);

		        function handleNotification(message) {
			        var m = JSON.parse(message.body);
			        toastr.info(m.msg);
		        }
	        });
        }
	</script>
	<th:block th:replace="avatar :: div" />
</body>
</html>
